<template>
  <div class="common-layout">
    <el-container>
      <el-header height="56px">
      <div class="common-header">
        <el-icon><Sunny /></el-icon>
        <span>
          WuJie
        </span>
      </div>
      </el-header>
      <el-container class="common-container">
        <el-aside width="200px">
          <el-menu
            class="el-menu-vertical-demo"
            default-active="/"
            router
          >
            <el-menu-item index="/">
              <el-icon>
                <icon-menu />
              </el-icon>
              <span>Vue 3.0</span>
            </el-menu-item>
            <el-menu-item index="3">
              <el-icon>
                <document />
              </el-icon>
              <span>React</span>
            </el-menu-item>
          </el-menu>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script lang="ts" setup>
import {
  Document,
  Menu as IconMenu,
  Sunny
} from '@element-plus/icons-vue'
const handleOpen = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
</script>
<style lang="less" scoped>
.common-layout {
  width: 100%;
  height: 100vh;

  .common-container {
    height: calc(100vh - 56px);
    // 菜单高度
    // el-aside{
    //   height: 100%;
    // }
    .el-menu{
      height: 100%;
    }
  }
}

.common-header{
  height: 56px;
  // line-height: 56px;
  display:flex;
  align-items: center;
  font-size: 18px;
  span{
    margin-left:8px;
  }
}
</style>
